home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / games / larn12s.arc / LARN.ARC / DATA.C < prev    next >
C/C++ Source or Header  |  1987-10-28  |  32KB  |  628 lines

  1. /*    data.c        Larn is copyrighted 1986 by Noah Morgan. */
  2. #define NODEFS
  3. #include "header.h"
  4.  
  5. /*
  6.     class[c[LEVEL]-1] gives the correct name of the players experience level
  7.  */
  8. static char aa1[] =    " mighty evil master";
  9. static char aa2[] =    "apprentice demi-god";
  10. static char aa3[] =    "  minor demi-god   ";
  11. static char aa4[] =    "  major demi-god   ";
  12. static char aa5[] =    "    minor deity    ";
  13. static char aa6[] =    "    major deity    "; 
  14. static char aa7[] =    "  novice guardian  ";
  15. static char aa8[] =    "apprentice guardian";
  16. static char aa9[] =    "    The Creator    ";
  17. char *class[]=
  18. {    "  novice explorer  ", "apprentice explorer", " practiced explorer",/*  -3*/
  19.     "   expert explorer ", "  novice adventurer", "     adventurer    ",/*  -6*/
  20.     "apprentice conjurer", "     conjurer      ", "  master conjurer  ",/*  -9*/
  21.     "  apprentice mage  ", "        mage       ", "  experienced mage ",/* -12*/
  22.     "     master mage   ", " apprentice warlord", "   novice warlord  ",/* -15*/
  23.     "   expert warlord  ", "   master warlord  ", " apprentice gorgon ",/* -18*/
  24.     "       gorgon      ", "  practiced gorgon ", "   master gorgon   ",/* -21*/
  25.     "    demi-gorgon    ", "    evil master    ", " great evil master ",/* -24*/
  26.       aa1       ,   aa1       ,   aa1       ,/* -27*/
  27.       aa1       ,   aa1       ,   aa1       ,/* -30*/
  28.       aa1       ,   aa1       ,   aa1       ,/* -33*/
  29.       aa1       ,   aa1       ,   aa1       ,/* -36*/
  30.       aa1       ,   aa1       ,   aa1       ,/* -39*/
  31.       aa2       ,   aa2       ,   aa2       ,/* -42*/
  32.       aa2       ,   aa2       ,   aa2       ,/* -45*/
  33.       aa2       ,   aa2       ,   aa2       ,/* -48*/
  34.       aa3       ,   aa3       ,   aa3       ,/* -51*/
  35.       aa3       ,   aa3       ,   aa3       ,/* -54*/
  36.       aa3       ,   aa3       ,   aa3       ,/* -57*/
  37.       aa4       ,   aa4       ,   aa4       ,/* -60*/
  38.       aa4       ,   aa4       ,   aa4       ,/* -63*/
  39.       aa4       ,   aa4       ,   aa4       ,/* -66*/
  40.       aa5       ,   aa5       ,   aa5       ,/* -69*/
  41.       aa5       ,   aa5       ,   aa5       ,/* -72*/
  42.       aa5       ,   aa5       ,   aa5       ,/* -75*/
  43.       aa6       ,   aa6       ,   aa6       ,/* -78*/
  44.       aa6       ,   aa6       ,   aa6       ,/* -81*/
  45.       aa6       ,   aa6       ,   aa6       ,/* -84*/
  46.       aa7       ,   aa7       ,   aa7       ,/* -87*/
  47.       aa8       ,   aa8       ,   aa8       ,/* -90*/
  48.       aa8       ,   aa8       ,   aa8       ,/* -93*/
  49.     "  earth guardian   ", "   air guardian    ", "   fire guardian   ",/* -96*/
  50.     "  water guardian   ", "  time guardian    ", " ethereal guardian ",/* -99*/
  51.       aa9       ,   aa9       ,   aa9       ,/* -102*/
  52. };
  53.  
  54. /*
  55.     table of experience needed to be a certain level of player
  56.     skill[c[LEVEL]] is the experience required to attain the next level
  57.  */
  58. #define MEG 1000000L
  59. long skill[] = {
  60. 0L, 10L, 20L, 40L, 80L, 160L, 320L, 640L, 1280L, 2560L, 5120L,         /*  1-11 */
  61. 10240L, 20480L, 40960L, 100000L, 200000L, 400000L, 700000L, 1*MEG,   /* 12-19 */
  62. 2*MEG,3*MEG,4*MEG,5*MEG,6*MEG,8*MEG,10*MEG,                          /* 20-26 */
  63. 12*MEG,14*MEG,16*MEG,18*MEG,20*MEG,22*MEG,24*MEG,26*MEG,28*MEG,      /* 27-35 */
  64. 30*MEG,32*MEG,34*MEG,36*MEG,38*MEG,40*MEG,42*MEG,44*MEG,46*MEG,      /* 36-44 */
  65. 48*MEG,50*MEG,52*MEG,54*MEG,56*MEG,58*MEG,60*MEG,62*MEG,64*MEG,      /* 45-53 */
  66. 66*MEG,68*MEG,70*MEG,72*MEG,74*MEG,76*MEG,78*MEG,80*MEG,82*MEG,      /* 54-62 */
  67. 84*MEG,86*MEG,88*MEG,90*MEG,92*MEG,94*MEG,96*MEG,98*MEG,100*MEG,     /* 63-71 */
  68. 105*MEG,110*MEG,115*MEG,120*MEG, 125*MEG, 130*MEG, 135*MEG, 140*MEG, /* 72-79 */
  69. 145*MEG,150*MEG,155*MEG,160*MEG, 165*MEG, 170*MEG, 175*MEG, 180*MEG, /* 80-87 */
  70. 185*MEG,190*MEG,195*MEG,200*MEG, 210*MEG, 220*MEG, 230*MEG, 240*MEG, /* 88-95 */
  71. 250*MEG,260*MEG,270*MEG,280*MEG, 290*MEG, 300*MEG                    /* 96-101*/
  72. };
  73. #undef MEG
  74.  
  75. char *lpbuf,*lpnt,*inbuffer,*lpend;    /* input/output pointers to the buffers */
  76. # ifndef UNIX
  77. RAMBLOCK *ramblks;
  78. DISKBLOCK *diskblks;
  79. # else
  80. struct cel *cell;    /*    pointer to the dungeon storage    */
  81. # endif
  82. short hitp[MAXX][MAXY];        /*    monster hp on level        */
  83. short iarg[MAXX][MAXY];    /*    arg for the item array    */
  84. char item[MAXX][MAXY];    /*    objects in maze if any    */
  85. char know[MAXX][MAXY];    /*    1 or 0 if here before    */
  86. char mitem[MAXX][MAXY];    /*    monster item array         */
  87. char moved[MAXX][MAXY];    /*    monster movement flags  */
  88. char stealth[MAXX][MAXY];    /*  0=sleeping 1=awake monst*/
  89. char iven[26];            /*    inventory for player            */
  90. short ivenarg[26];        /*    inventory for player            */
  91. char lastmonst[40];        /*    this has the name of the current monster    */
  92. char beenhere[MAXLEVEL+MAXVLEVEL];    /*  1 if have been on this level */
  93. char VERSION=VER;    /*    this is the present version # of the program    */
  94. char SUBVERSION=SUBVER;
  95. char nosignal=0;    /* set to 1 to disable the signals from doing anything */
  96. char predostuff=0;    /*  2 means that the trap handling routines must do a
  97.                         showplayer() after a trap.  0 means don't showplayer()
  98.                         0 - we are in create player screen
  99.                         1 - we are in welcome screen
  100.                         2 - we are in the normal game    */
  101. char loginname[20];        /* players login name */
  102. char logname[LOGNAMESIZE];    /* players name storage for scoring                */
  103. char sex=1;                /*  default is a man  0=woman                        */
  104. char boldon=1;            /*  1=bold objects  0=inverse objects                */
  105. char ckpflag=0;            /*    1 if want checkpointing of game, 0 otherwise    */
  106. char cheat=0;            /*    1 if the player has fudged save file            */
  107. char level=0;            /*  cavelevel player is on = c[CAVELEVEL]            */
  108. char wizard=0;            /*    the wizard mode flag                            */
  109. short lastnum=0;        /* the number of the monster last hitting player     */
  110. short hitflag=0;        /*    flag for if player has been hit when running     */
  111. short hit2flag=0;        /*    flag for if player has been hit when running     */
  112. short hit3flag=0;        /*    flag for if player has been hit flush input     */
  113. short playerx,playery;    /*    the room on the present level of the player        */
  114. short lastpx,lastpy;    /*    0 --- MAXX-1  or  0 --- MAXY-1                    */
  115. short oldx,oldy;
  116. short lasthx=0,lasthy=0;    /* location of monster last hit by player        */
  117. short nobeep=0;            /* true if program is not to beep                      */
  118. unsigned long randx=33601;    /*    the random number seed                        */
  119. long initialtime=0;            /* time playing began                             */
  120. long gtime=0;                /*    the clock for the game                        */
  121. long outstanding_taxes=0;    /* present tax bill from score file             */
  122. long c[100],cbak[100];        /*    the character description arrays            */
  123. int enable_scroll=0;        /* constant for enabled/disabled scrolling regn */
  124. char aborted[] = " aborted";
  125. struct sphere *spheres=0; /*pointer to linked list for spheres of annihilation*/
  126. char *levelname[]=
  127. { " H"," 1"," 2"," 3"," 4"," 5"," 6"," 7"," 8"," 9","10","V1","V2","V3" };
  128.  
  129. #ifdef DGK
  130. char objnamelist[]=".ATOP<^F&^+M=>^$$f*OD#~][[)))(((||||||||{?!BC}o:;,@@@@EVV))([[]]](^.[H***.^^.S.tsTLc,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,";
  131. char monstnamelist[]=".BGHJKOScjtAELNQRZabhiCTYdegmvzFWflorXV.pqsyUkMwDDPxnDDuD........,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,";
  132. char floorc = '.';
  133. char wallc = '#';
  134. #ifdef MSDOS
  135. int DECRainbow, keypad;
  136. #endif
  137. #else
  138. char objnamelist[]=" ATOP%^F&^+M=%^$$f*OD#~][[)))(((||||||||{?!BC}o:@.<<<<EVV))([[]]](^ [H*** ^^ S tsTLc............................................";
  139. char monstnamelist[]=" BGHJKOScjtAELNQRZabhiCTYdegmvzFWflorXV pqsyUkMwDDPxnDDuD        ...............................................................";
  140. # endif
  141. char *objectname[]=
  142. { 0,"a holy altar","a handsome jewel encrusted throne","the orb","a pit",
  143.   "a staircase leading upwards","an elevator going up","a bubbling fountain",
  144.   "a great marble statue","a teleport trap","the college of Larn",
  145.   "a mirror","the DND store","a staircase going down","an elevator going down",
  146.   "the bank of Larn","the 5th branch of the Bank of Larn",
  147.   "a dead fountain","gold","an open door","a closed door",
  148.   "a wall","The Eye of Larn","plate mail","chain mail","leather armor",
  149.   "a sword of slashing","Bessman's flailing hammer","a sunsword",
  150.   "a two handed sword","a spear","a dagger",
  151.   "ring of extra regeneration","a ring of regeneration","a ring of protection",
  152.   "an energy ring","a ring of dexterity","